package com.moss.cloud.base.biz.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.moss.cloud.base.api.model.from.UserLockFrom;
import com.moss.cloud.base.api.model.from.UserUnlockFrom;
import com.moss.cloud.base.biz.model.AccountLockRecord;

import java.time.LocalDateTime;

/**
 * 账号锁定记录业务接口
 *
 * @author 瑾年
 * @date 2023年4月6日
 */
public interface IAccountLockRecordService extends IService<AccountLockRecord> {
    /**
     * 新增用户账号锁定记录
     *
     * @param lockTime
     * @param userLockFrom
     * @return
     */
    boolean saveOrUpdateLockAccount(LocalDateTime lockTime, UserLockFrom userLockFrom);

    /**
     * 根据用户ID查询账号锁定详情
     *
     * @param userId
     * @return
     */
    AccountLockRecord findByUserId(Long userId);

    /**
     * 解锁账号
     * @param time
     * @param userUnlockFrom
     * @return
     */
    boolean unlockAccount(LocalDateTime time,UserUnlockFrom userUnlockFrom);
}
